import { defAxios as request } from '@/utils/http'

/**
 * @description: 获取音视频上传地址和凭证
 * @param {Object} params
 * @return {Object}
 */
export function getAuth(params) {
  return request({
    url: '/aliyuncsVod/createUploadVideo',
    method: 'get',
    params
  })
}

/**
 * @description: 刷新音/视频上传凭证
 * @param {String} videoId
 * @return {*}
 */
export function refreshAuth(videoId) {
  return request({
    url: '/aliyuncsVod/refreshUploadVideo',
    method: 'get',
    params: {
      videoId
    }
  })
}

/**
 * @description: 获取图片上传鉴权
 * @param {String} objectName
 * @return {*}
 */
export function getOssAuth(objectName) {
  return request({
    url: '/aliyunOss/getSecurityToken',
    method: 'get',
    responseAll: true,
    params: {
      objectName
    }
  })
}

/**
 * @description: 上传离线视频地址
 * @param {String} params
 * @return {*}
 */
export function uploadVideoUrl(data) {
  return request({
    url: '/inspection/uploadVideoUrl',
    method: 'post',
    data
  })
}

/**
 * @description: 查询任务状态 页面滑动展示
 * @param {String} params
 * @return {*}
 */
export function getAccidentList(data) {
  return request({
    url: '/accident/getList',
    method: 'get',
    data
  })
}

